<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css">
</head>
<body ng-app="myApp" ng-controller="myCtrl">
    
<nav class="navbar navbar-default">
        <div class="container-fluid">
            <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">WEB大本营</a>
            </div>
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li><a href="#">学员管理 <span class="sr-only">(current)</span></a></li>
                <li class="active"><a href="#">通讯录管理</a></li>
            </ul>
            <form class="navbar-form navbar-left">
                <div class="form-group">
                <input type="text" class="form-control" placeholder="Search">
                </div>
                <button type="submit" class="btn btn-default">Submit</button>
            </form>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="#">{{abc}}</a></li>
            </ul>
            </div>
        </div>
    </nav>

    <div>
        <div class="col-lg-9 btn-group" role="group" aria-label="...">
            <button ng-click="addAddress()" type="button" class="btn btn-default">添加</button>
            <button ng-click="modAddress()" type="button" class="btn btn-default" ng-disabled="option.chkedUserArr.length != 1">修改</button>
            <button ng-click="delUser()" type="button" class="btn btn-default" ng-disabled="option.chkedUserArr.length == 0" >删除</button>
        </div>

        <div class="col-lg-3">
            <div class="input-group">
            <input type="text" class="form-control" placeholder="Search for...">
            <span class="input-group-btn">
                <button class="btn btn-default" type="button">Go!</button>
            </span>
            </div><!-- /input-group -->
        </div><!-- /.col-lg-6 -->
    </div>

    <div class="col-lg-12" style="margin-top:20px;">
        <table class="table table-bordered table-hover">
            <thead>
                <tr>
                    <th>操作 <input type="checkbox" ng-click="chkedAll($event)"></th>
                    <th>序号</th>
                    <th>姓名</th>
                    <th>年龄</th>
                    <th>性别</th>
                    <th>手机号</th>
                    <th>邮箱</th>
                    <th>QQ号</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="user in option.userList">
                    <td><input type="checkbox" ng-click="chkedOne()" ng-model="option.chks[user.id]"></td>
                    <td>{{$index+1}}</td>
                    <td>{{user.name}}</td>
                    <td>{{user.age}}</td>
                    <td>{{user.gender}}</td>
                    <td>{{user.phone}}</td>
                    <td>{{user.email}}</td>
                    <td>{{user.qq}}</td>
                </tr>
            </tbody>
        </table>
    </div>

    <div class="col-lg-12">
        <nav aria-label="Page navigation">
            <ul class="pagination">
                <li ng-click="prevPage()"
                ng-class="{disabled: option.curPage == 1}">
                    <a href="javascript:;">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
                <li ng-click="jumping()"
                ng-class="{active: option.curPage == $index+1}"
                ng-repeat="page in option.totalPage">
                    <a href="javascript:;">{{$index+1}}</a>
                </li>
                <li ng-click="nextPage()"
                ng-class="{disabled: option.curPage == option.totalPage.length}">
                    <a href="javascript:;">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            </ul>
        </nav>
    </div>

    <!-- 模态框 -->
    <div class="modal fade" id="addressModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel">{{option.modelTitle}}</h4>
                </div>
                <div class="modal-body">

                    <form class="form-horizontal">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">姓名</label>
                            <div class="col-sm-9">
                                <input ng-model="user.name" type="text" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">年龄</label>
                            <div class="col-sm-9">
                                <input ng-model="user.age" type="text" class="form-control" />
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">性别</label>
                            <div class="col-sm-9">
                                <label class="radio-inline">
                                    <input ng-model="user.gender" type="radio" name="gender" value="男"> 男
                                </label>
                                <label class="radio-inline">
                                    <input ng-model="user.gender" type="radio" name="gender" value="女"> 女
                                </label>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">手机号</label>
                            <div class="col-sm-9">
                                <input ng-model="user.phone" type="text" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">邮箱</label>
                            <div class="col-sm-9">
                                <input ng-model="user.email" type="text" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">QQ</label>
                            <div class="col-sm-9">
                                <input ng-model="user.qq" type="text" class="form-control" />
                            </div>
                        </div>
                    </form>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button ng-click="saveUser()" type="button" class="btn btn-primary">提交更改</button>
                </div>
            </div>
        </div>
    </div>

    <script src="../node_modules/jquery/dist/jquery.js"></script>
    <script src="../node_modules/bootstrap/dist/js/bootstrap.js"></script>
    <script src="../node_modules/angular/angular.js"></script>
    <script src="./ceshi.js"></script>
</body>
</html>